import Vue from "vue";
import loading from "./loading.vue";
const loadingDirective = {
    inserted(el,binding){
        const loadingCtor = Vue.extend(loading)
        const loadingComp = new loadingCtor().$mount()
        el.instancer = loadingComp
        if (binding.value){
            append(el)
        }

        function append(el){
            el.appendChild(el.instancer.$el)
        }

    }
}


export default loadingDirective